<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="m" uri="/cutm_tags"%>

<head>
<title>记者发稿打分打等统计</title>
<script type="text/javascript">
$(document).ready(function(){
	document.getElementById("auditType").value="<s:property value='lsqModel.auditType'/>";
	document.getElementById("userType").value="<s:property value='lsqModel.userType'/>";
	if('<s:property value="lsqModel.ubegDate"/>'==null || '<s:property value="lsqModel.uendDate"/>'=="") {
		$("input[name='lsqModel.ubegDate']").val("");
	}
	if('<s:property value="lsqModel.uendDate"/>'==null || '<s:property value="lsqModel.uendDate"/>'=="") {
		$("input[name='lsqModel.uendDate']").val("");
	}
});
	
function togle(dv){
	$('#s'+dv).toggle(function(){
		$('#'+dv).show();
		$('#s'+dv).attr('src','<s:url value="/common/images/optImg/minus.png"/>');
		},function(){
			$('#'+dv).hide();
			$('#s'+dv).attr('src','<s:url value="/common/images/optImg/plus.png"/>');
		});
}
</script>
</head>
<body>
<h2 class="title">统计条件：</h2>
<s:form id="LevelScoreSumForm" action="statistics/LevelScoreSum!toQuery">
	<table class="form">
		<tr>
			<th width="10%">用户：</th>
			<td width="15%"><m:dropUser name="lsqModel.userId" headKey="--请选择--" headValue="" /></td>
			<th width="10%">用户身份：</th>
			<td width="15%"><select id="userType" class="" name="lsqModel.userType">
				<option title="" value="1">记者</option>
				<option title="" value="2">配音</option>
				<option title="" value="3">编辑</option>
			</select></td>
			<th width="10%">撰稿日期:</th>
			<td width="40%"><m:date name="lsqModel.begDate" cssClass="rule[date]" />--<m:date name="lsqModel.endDate"
				cssClass="rule[date]" /></td>
		</tr>
		<tr>
			<th>关键字：</th>
			<td><s:textfield name="lsqModel.title" /></td>
			<th>文稿状态：</th>
			<td><select id="auditType" class="" name="lsqModel.auditType">
				<option title="" value="-1">全部状态</option>
				<option title="" value="0">草稿</option>
				<option title="" value="1">一审中</option>
				<option title="" value="2">二审中</option>
				<option title="" value="3">三审中</option>
				<option title="" value="4">审核完毕</option>
				<option title="" value="-100">毙稿</option>
			</select></td>
			<th>录用日期:</th>
			<td><m:date name="lsqModel.ubegDate" cssClass="rule[date]" />--<m:date name="lsqModel.uendDate"
				cssClass="rule[date]" /></td>
		</tr>
	</table>
	<div class="btnGroup"><input type="submit" value="查询" /></div>
</s:form>

<h2 class="title">打分打等统计汇总</h2>
<table class="list">
	<thead>
		<tr>
			<th width="5%">序号</th>
			<th width="8%">姓名</th>
			<th width="10%">标题</th>
			<th width="9%">撰稿日期</th>
			<th width="7%">使用日期</th>
			<th width="6%">稿件等级</th>
			<th width="6%">配音人员</th>
			<th width="6%">配音分数</th>
			<th width="7%">编辑人员</th>
			<th width="6%">编辑分数</th>
			<th width="6%">使用次数</th>
		</tr>
	</thead>
	<tbody>
		<s:set name="gradeTotal" value="0" />
		<s:set name="timesTotal" value="0" />
		<s:iterator value="lsqm" status="aa">
			<tr>
				<td><s:property value="#aa.index+1" /></td>
				<td><m:imgA img="plus" msg="显示" onclick="togle(${id})" id="s${id}" /> <s:property value="manuscript.user.name" /></td>
				<td><s:property value="manuscript.title" /></td>
				<td><s:date name="manuscript.createDate" format="yyyy-MM-dd HH:mm" /></td>
				<td><s:date name="manuscript.usedDate" format="yyyy-MM-dd" /></td>
				<td><m:property value="manuscript.level" /></td>
				<td><s:property value="manuscript.puser.name" /></td>
				<td><m:property value="manuscript.puserScore" /></td>
				<td><s:property value="editUser" /></td>
				<td><m:property value="level1Score" /></td>
				<td><a title="详细信息" href="../programming/SearchProgram!getProgrammingsByMans.action?manusId=${manuscript.id}"
					target="_blank"><s:property value="manuscript.times" /></a></td>
			</tr>
			<tr id="${id}" style="display: none;">
				<td></td>
				<td style="text-align: right">详细信息</td>
				<td colspan="8">
				<table class="list">
					<thead>
						<tr style="color: #4F4F4F">
							<th width="20%">参与者</th>
							<th width="20%">分数</th>
							<th width="20%">打分人</th>
							<th width="20%">打分日期</th>
							<th width="20%">发稿条数</th>
						</tr>
					</thead>
					<tbody>
						<s:if test="gaoJian2Reporters.size>0">
							<s:set name="pTimes" value="1"></s:set>
							<s:iterator value="gaoJian2Reporters">
								<tr>
									<td><s:property value="reporter.name" /></td>
									<td><s:property value="score" /></td>
									<td><s:property value="auditor.name" /></td>
									<td><s:date name="scoreDate" format="yyyy-MM-dd HH:mm" /></td>
									<td><s:property value="fgCount" /></td>
								</tr>
								<s:if test="lsqModel.userId==null || lsqModel.userId==reporter.id">
									<s:set name="gradeTotal" value="#gradeTotal+score" />
									<s:set name="timesTotal" value="#timesTotal+fgCount" />
								</s:if>
							</s:iterator>
						</s:if>
						<s:else>
									没有相关的记录！
								</s:else>
					</tbody>
				</table>

				</td>
			</tr>
		</s:iterator>
		<tr>
			<td colspan="4" style="text-align: right;">合计:</td>
			<td>发稿条数：<s:property value="@com.monlyu.util.MathUtil@formatFraction(#timesTotal,1)" /></td>
			<td>记者分数：<s:property value="@com.monlyu.util.MathUtil@formatFraction(#gradeTotal,1)" /></td>
			<td colspan="2">配音人员分数：<s:property value="@com.monlyu.util.MathUtil@formatFraction(wgscore,1)" /></td>
			<td colspan="2">编辑人员分数：<s:property value="@com.monlyu.util.MathUtil@formatFraction(bjsorce,1)" /></td>
			<td><s:property value="sytimes" /></td>
		</tr>
	</tbody>
</table>
</body>